Learn R Programming

XML (version 1.2-0)

[<-.XMLNode: Assign sub-nodes to an XML node

Description

These functions allow one to assign a sub-node to an existing XML node by name or index. These are the assignment equivalents of the subsetting accessor functions. They are typically called indirectly via the assignment operator, such as x[["myTag"]] <- xmlNode("mySubTag").

Usage

x[i] <- value
"[<-.XMLNode"(x, i, value)
"[[<-.XMLNode"(x, i, value)

Arguments

Value

  • The XML node x containing the new or modified nodes.

References

http://www.w3.org, http://www.omegahat.org/RSXML

See Also

[.XMLNode [[.XMLNode append.xmlNode xmlSize

Examples

Run this code
top <- xmlNode("top", xmlNode("next","Some text"))
 top[["second"]] <- xmlCDataNode("x <- 1:10")
 top[[3]] <- xmlNode("tag",attrs=c(id="name"))

Run the code above in your browser using DataLab